package com.itshidu.game.controller

import com.baomidou.mybatisplus.core.conditions.Wrapper
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
import com.itshidu.game.entity.HeroEquipment
import com.itshidu.game.mapper.HeroEquipmentMapper
import com.itshidu.game.mapper.HeroItemMapper
import com.itshidu.game.mapper.HeroMapper
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/game/equipment")
public class EquipmentController extends BaseController{

    @Autowired HeroEquipmentMapper heroEquipmentMapper
    @Autowired HeroMapper heroMapper
    @Autowired HeroItemMapper heroItemMapper

    @RequestMapping("/mine")
    my_equipment(Model model) {
        def hero = heroMapper.selectById(getCurrentHero().id)
        HeroEquipment equipment = heroEquipmentMapper.selectById(hero.id)
        if (equipment!=null) {

        }
        model.addAttribute('equ',equipment)
        return 'game/equipment/mine'
    }
}
